﻿using Microsoft.Extensions.Options;
using seejee_Backendium.Core.Interfaces;
using seejee_Backendium.Core.Models;
using seejee_Backendium.Data.Repositores;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace seejee_Backendium.Data.Services
{
    public class UserService : IUserService
    {
        private readonly UserRepository _userRepository;

        public UserService(UserRepository userRepository)
        {
            _userRepository = userRepository;
        }

        public PagedResult<UserInfoDTO> GetAllUsers(int pageIndex, int pageSize,string keyword) => _userRepository.GetAllUsers(pageIndex, pageSize, keyword);

        public User GetUserById(string cCusName) => _userRepository.GetUserById(cCusName);

        public bool InsertUser(UserInsertDTO users) => _userRepository.InsertUser(users);
        public bool UpdateUser(UserUpdate user) => _userRepository.UpdateUser(user);
        public bool UpdatePassword(UserPasswordDTO userUpdatePassword) => _userRepository.UpdatePassword(userUpdatePassword);

        public bool DeleteUser(string cCusName) => _userRepository.DeleteUser(cCusName);


        public bool UserNameSearch(string cCusName) => _userRepository.UserNameSearch(cCusName);


        public bool ValidateUser(string cCusName, string cCusPassword) => _userRepository.ValidateUser(cCusName,cCusPassword);


    }
}
